#ifndef FUNCTIONS_H
#define FUNCTIONS_H
#include <vector_types.h>
#include <helper_image.h>


uchar4* copy(uchar4* a, int width, int height);
bool compareUchar4(uchar4* buf1,uchar4* buf2,int width, int height);


/**
 * compare two integer's array
 * PRE:buf2 != NULL && buf1 != NULL && buf1 and buf2 have space for width*height integers
 * @param buf1 integer's array
 * @param buf2 integer's array
 * @param width integer
 * @param height integer
 * @return case equal true
 * 		   		else false
 */
bool compare(int* buf1,int* buf2,int width, int height);

/**
 *
 * @return the numbers of CUDA's devices that exist in the machine
 */
int chooseCudaDevice();

/**
 * Convert buf in an image. The image's name is filename
 * PRE: buf != NULL && buf has space for width*height integers && filename != NULL
 * @param filename string
 * @param buf  integer's array
 * @param width integer
 * @param height integer
 */
void toImage(char* filename, int* buf,int width,int height);
#endif
